package by.exposit.dao;

import by.exposit.dao.entity.CommentEntity;
import by.exposit.dao.entity.DonateEntity;
import by.exposit.domain.User;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
@Transactional
public class DonateDAOImpl extends GenericDAOImpl<DonateEntity,Long> implements DonateDAO {




	@Override
	public List<DonateEntity> donateUserList(User user) {

        Criteria cr = getSession()
                .createCriteria(CommentEntity.class, "Comment")
                .add(Restrictions.eq("UserID", user));
        return cr.list();
	}



}
